package hu.mapro.gwtui.server;

import javax.persistence.criteria.Expression;
import javax.persistence.criteria.Root;

import hu.mapro.gwtui.client.data.SortBuilder;

public class SortBuilderImpl<T> implements SortBuilder {

	Root<T> root;
	
	Expression<?> expression;
	
	public Expression<?> getExpression() {
		return expression;
	}

	public SortBuilderImpl(Root<T> root) {
		this.root = root;
	}

	@Override
	public void namedField(String name) {
		expression = root.get(name);
	}

}
